import request from '@/utils/request'
export const getEmployeeList = params => {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}
export const exportEmployee = function() {
  return request({
    url: '/sys/user/export',
    method: 'get',
    responseType: 'blob'
  })
}
// 导出excel模板
export const importEmployee = function() {
  return request({
    url: '/sys/user/import/template',
    method: 'get',
    responseType: 'blob'
  })
}
// 导入员工模板
export const importEmployeeData = function(data) {
  return request({
    url: '/sys/user/import',
    method: 'post',
    data
  })
}
// 删除员工
export const delEmployee = id => {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 新增员工
export const addEmployee = data => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 编辑员工,回显员工信息
export const editEmployee = id => {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
// 修改员工信息
export const updateEmployee = data => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

